import re
from playwright.sync_api import Playwright, sync_playwright, expect


def run(playwright: Playwright) -> None:
    browser = playwright.chromium.launch(headless=False)
    # 读取身份状态
    context = browser.new_context(storage_state='../auto.json')
    page = context.new_page()
    page.goto("http://81.70.166.221:8080/system/user")
    print(page.title())

    # ---------------------
    context.close()
    browser.close()


with sync_playwright() as playwright:
    run(playwright)
